package cn.iocoder.yudao.module.digital.enums.cardkeysecret;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 请求类型
 *
 * @author lizhognwen
 */
@Getter
@AllArgsConstructor
public enum CardKeyApiRequestTypeEnum {
    GENERATE("Generate", "生成礼品卡"),
    REVERSE("Reverse", "撤销礼品卡"),
    GET_ACCOUNT("GetAccount", "获取卡密账户");

    private final String value;
    private final String desc;

    public String getValue() {
        return value;
    }

    public CardKeyApiRequestTypeEnum fromValue(String value) {
        for (CardKeyApiRequestTypeEnum type : values()) {
            if (type.value.equals(value)) {
                return type;
            }
        }
        throw new IllegalArgumentException("枚举类型 CardKeyApiRequestTypeEnum 不支持的值：" + value);
    }

}
